package com.lucian.ge.service.shop.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lucian.ge.dao.shop.ProductMapper;
import com.lucian.ge.service.shop.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Lucicol on 2019/6/20.
 */
@Service("ProductService")
public class ProductServiceImpl implements ProductService {

    @Autowired(required=false)
    private ProductMapper productMapper;

    public List<Map<String, String>> getProductList(Integer categoryId) {
        List<Map<String, String>> productList = productMapper.selectList(categoryId);
//        System.out.println(productList);
        return productList;
    }

    public Map<String, String> getProduct(Integer id) {
        Map<String, String> product = productMapper.selectpro(id);
//        System.out.println("pc"+JSON.toJSONString(product));
        return product;
    }

}
